﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;

namespace Demos.DesignPatterns._11_外观模式
{
    /// <summary>
    /// 外观类
    /// </summary>
    public class HomeTheaterFacade
    {
        private readonly Projector _projector;
        private readonly SoundSystem _sound;
        private readonly BluRayPlayer _player;
        private readonly Lights _lights;

        public HomeTheaterFacade()
        {
            _projector = new Projector();
            _sound = new SoundSystem();
            _player = new BluRayPlayer();
            _lights = new Lights();
        }

        public void WatchMovie(string movie)
        {
            Console.WriteLine("准备家庭影院...");
            _lights.Dim(30);
            _projector.On();
            _projector.SetInput("HDMI");
            _projector.WideScreenMode();
            _sound.On();
            _sound.SetVolume(60);
            _player.On();
            _player.PlayMovie(movie);
        }

        public void EndMovie()
        {
            Console.WriteLine("\n关闭家庭影院...");
            _lights.Dim(100);
            _projector.Off();
            _sound.Off();
            _player.Off();
        }

    }
}
